package com.framework.test.utils;

/**
 * 路径配置工具类
 * 支持新的配置文件结构：application.properties/yml 和环境特定配置
 */
public class PathConfigUtil {

    // 配置文件路径常量
    private final static String CONFIG_BASE_PATH = "./src/main/resources/";
    private final static String APPLICATION_PROPERTIES = CONFIG_BASE_PATH + "application.properties";
    private final static String APPLICATION_YML = CONFIG_BASE_PATH + "application.yml";
    
    private static String OUTPUT_DIR_NAME = "";
    private static String OUTPUT_DIR = "";
    private static String REPORTS_PATH = "";
    private static String APPLOGS_PATH = "";

    public static String getOutputDirName() {
        return OUTPUT_DIR_NAME;
    }

    public static void setOutputDirName(String outputDirName) {
        OUTPUT_DIR_NAME = outputDirName;
    }

    public static String getOutputDir() {
        return OUTPUT_DIR;
    }

    public static void setOutputDir(String outputDir) {
        OUTPUT_DIR = outputDir;
    }

    public static String getReportsPath() {
        return REPORTS_PATH;
    }

    public static void setReportsPath(String reportsPath) {
        REPORTS_PATH = reportsPath;
    }

    public static String getApplogsPath() {
        return APPLOGS_PATH;
    }

    public static void setApplogsPath(String applogsPath) {
        APPLOGS_PATH = applogsPath;
    }

    /**
     * 获取配置文件基础路径
     */
    public static String getConfigBasePath() {
        return CONFIG_BASE_PATH;
    }
    
    /**
     * 获取application.properties文件路径
     */
    public static String getApplicationProperties() {
        return APPLICATION_PROPERTIES;
    }
    
    /**
     * 获取application.yml文件路径
     */
    public static String getApplicationYml() {
        return APPLICATION_YML;
    }
    
    /**
     * 获取环境特定的配置文件路径
     */
    public static String getProfileConfigPath(String profile, String extension) {
        return CONFIG_BASE_PATH + "application-" + profile + "." + extension;
    }
    
    /**
     * @deprecated 使用 getApplicationProperties() 替代
     * 保留此方法以保持向后兼容性
     */
    @Deprecated
    public static String getPropertiesTest() {
        return APPLICATION_PROPERTIES;
    }
}
